package com.fac.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 创建租赁订单DTO
 */
@Data
@ApiModel(description = "创建租赁订单请求参数")
public class LeaseOrderCreateDTO implements Serializable {

    @NotNull(message = "设备ID不能为空")
    @ApiModelProperty(value = "设备ID", example = "1", required = true)
    private Long equipmentId;

    @NotNull(message = "开始时间不能为空")
    @ApiModelProperty(value = "开始时间", example = "2024-01-01 12:00:00", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @NotNull(message = "预计归还时间不能为空")
    @ApiModelProperty(value = "预计归还时间", example = "2024-01-05 12:00:00", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expectedReturnTime;

    @NotBlank(message = "计费类型不能为空")
    @ApiModelProperty(value = "计费类型：日、周、月、年", example = "日", required = true)
    private String chargeType;

    @NotBlank(message = "联系人不能为空")
    @ApiModelProperty(value = "联系人", example = "张三", required = true)
    private String contactPerson;

    @NotBlank(message = "联系电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @ApiModelProperty(value = "联系电话", example = "13800138000", required = true)
    private String contactPhone;
} 